Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
sindresorhus / esm-package.md
Last active May 11, 2024 11:39
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@wojteklu
wojteklu / clean_code.md
Last active May 11, 2024 11:36
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@zmts
zmts / tokens.md
Last active May 11, 2024 07:14
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@davepcallan
davepcallan / FindSparseColumnCandidates.sql
Created May 11, 2024 10:24
SQL Server SQL script to find sparse column candidates
USE TestDB
GO
DECLARE @DatabaseName VARCHAR(100)
DECLARE @SchemaName VARCHAR(100)
DECLARE @TableName VARCHAR(100)
DECLARE @ColumnName VARCHAR(100)
DECLARE @FullyQualifiedTableName VARCHAR(500)
--Create Temp Table to Save Results
# include <Siv3D.hpp> // Siv3D v0.6.14
struct Ball
{
P2Body body;
double r;
Color color;
};
void Main()
@nafiesl
nafiesl / how_to_get_telegram_chat_id.md
Created December 20, 2023 11:49
How to get Telegram Bot Chat ID

How to get Telegram Bot Chat ID

Create a Telegram Bot and get a Bot Token

  1. Open Telegram application then search for @BotFather
  2. Click Start
  3. Click Menu -> /newbot or type /newbot and hit Send
  4. Follow the instruction until we get message like so
    Done! Congratulations on your new bot. You will find it at t.me/new_bot.
    
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 11, 2024 11:30
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@snower
snower / logging_file_lock_handler.py
Created May 31, 2023 01:27
logging_file_lock_handler
# -*- coding: utf-8 -*-
# 14-8-20
# create by: snower
import os
import time
import struct
import fcntl
from logging.handlers import RotatingFileHandler, TimedRotatingFileHandler
@noteeeeee
noteeeeee / JetBrainsActivation.md
Last active May 11, 2024 11:19
Webstorm/JetBrains products activation 2024 (Windows/MacOS)

Webstorm/JetBrains products activation 2024 (Windows/MacOS)

1.Proxy Settings

  1. Step 1: Navigate to Proxy settings.
  2. Step 2: Select "Manual proxy settings - HTTP".
    • Hostname: localhost
    • Port: 80

Set no proxy for:

@PurpleBooth
PurpleBooth / README-Template.md
Last active May 11, 2024 11:19
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites